<?php #coding: utf-8 æ ø å ?>

<?php

	//echo "<br><br>START: view->basisinformation/individ";


// BIRTH OG DEATH - her udskrives fÃ¸dsels og dÃ¸d eller tilsvarende, ligegyldigt om der er tale om entitet, sted eller begivenhed.

if($er_jeg_admin == "ja") 
{
	if(!isset($stamdata['birth']) or $stamdata['birth'] == 0)
	{
		$ret_birth_link="<a class='rediger' title='Rediger' href='".base_url()."core/vis/se/".$type."/".$stamdata['id']."/rediger_birth'></a>";
	}
	else
	{
		$ret_birth_link="";
	}

	if(!isset($stamdata['death']) or $stamdata['death'] == 0)
	{
		$ret_death_link="<a class='rediger' title='Rediger' href='".base_url()."core/vis/se/".$type."/".$stamdata['id']."/rediger_death'></a>";
	}
	else
	{
		$ret_death_link="";
	}
}
else
{
	$ret_birth_link="";
	$ret_death_link="";
}
echo "<p class='ink'><b class='rubrik'>".$birth_ord.": </b>".$stamdata['birth_navn'].$ret_birth_link;
if($stamdata['death'] == 0 and $stamdata['birth'] != 0)
{
	$alder = $this->tid_model->alder($stamdata['birth'], $ingame_nu['tid_db']);
	
	if($stamdata['birth'] > $ingame_nu['tid_db']){ //hvis birth er i fremtiden
		$alder = $this->tid_model->alder($ingame_nu['tid_db'],$stamdata['birth']);
		echo "&nbsp;&nbsp;&nbsp;&nbsp;(om ".$alder.")";
	}else{
		echo "&nbsp;&nbsp;&nbsp;&nbsp;(".$alder.")";
	}
}

echo "<br>";
echo "<p class='ink'><b class='rubrik'>".$death_ord.": </b>".$stamdata['death_navn'].$ret_death_link;
if($stamdata['death'] != 0)
{
	$alder_ved_doed = $this->tid_model->alder($stamdata['birth'],$stamdata['death']);
	echo "&nbsp;&nbsp;&nbsp;&nbsp;(blev ".$alder_ved_doed.")";
}elseif($stamdata['birth'] == 0 and $stamdata['death'] != 0){
	$alder = $this->tid_model->alder($stamdata['death'], $ingame_nu['tid_db']);
	if($stamdata['death'] > $ingame_nu['tid_db']){ //hvis birth er i fremtiden
		$alder = $this->tid_model->alder($ingame_nu['tid_db'],$stamdata['death']);
		echo "&nbsp;&nbsp;&nbsp;&nbsp;(om ".$alder.")";
	}else{
		echo "&nbsp;&nbsp;&nbsp;&nbsp;(for ".$alder." siden)";
	}
}

echo "<p class='ink'>";
if((string)$koen != "0")
	{
			echo "<b class='rubrik'>Køn: </b>";
			echo $koen;
	}
	else{
		echo "<p class='ink'>";
			echo "<b class='rubrik'>Køn:</b> Ukendt";
		
	}
	if($er_jeg_admin == "ja") {
		echo anchor("core/vis/se/individ/".$stamdata['id']."/rediger_koen"," ","class='rediger'");
	}
echo "</p>";

	if(isset($race))
	{
		echo "<p class='ink'>";
			echo "<b class='rubrik'>Æt: </b>";
			echo $race;
		echo "</p>";
	}
	else{
		echo "<p class='ink'>";
			echo "<b class='rubrik'>Æt:</b> Ukendt";
		
		if($er_jeg_admin == "ja") {
			echo anchor("core/vis/se/individ/".$stamdata['id']."/rediger_race"," ","class='rediger'");
		}
		echo "</p>";
	}



if($er_jeg_admin == "ja"){
	//PROFESSION
	echo "<p class='rubrik'>";
				echo "<b>Profession:</b> ".$profession;
    			echo anchor("core/vis/se/individ/".$stamdata['id']."/rediger_profession"," ","class='rediger'");
	echo "</p>";
	//LEVEL
	echo "<p class='rubrik'>";
				echo "<b>Level:</b> ".$level;
	echo "</p>";
	//STATS
	echo "<p class='rubrik'>";
				echo anchor('core/vis/se/individ/'.$id.'/stats', "<b>Stats:</b>", "class='rubrik'");
				if($sidste_temp_stats != 0){
					$stat_navne = array_keys($sidste_temp_stats);
					$stat_vaerdier = array_values($sidste_temp_stats);
						//echo "<br>stat_navne er "; print_r($stat_navne);
					echo "<br>Højst: ";
					echo $stat_navne[10]."(".$stat_vaerdier[10]."), ";
					echo $stat_navne[9]."(".$stat_vaerdier[9].")";
					echo "<br>Lavest: ";
					echo $stat_navne[0]."(".$stat_vaerdier[0]."), ";
					echo $stat_navne[1]."(".$stat_vaerdier[1].")";
				}
	echo "</p>";
}





if(isset($rollespiller)) //relevant for player_characters
{
	echo "<p class='rubrik'><b>Rollespiller</b>: ".$rollespiller."</p>";
}

echo "<p>".anchor("core/vis/se/individ/".$stamdata['id']."/familie","Familie","class='ink'");
if($er_jeg_admin == "ja"){
	echo anchor("core/vis/se/individ/".$stamdata['id']."/rediger_familie", " ", "class='rediger'");
}
echo "</p>";

// TITLER
$person = new entitet();
$person->find_alle_titler($stamdata['id']);
$alle_titler = $person->alle_titler;

echo "<p class='ink'><b class='rubrik'>Titler</b>: ";
if($er_jeg_admin == "ja") {
	echo anchor("core/vis/se/individ/".$stamdata['id']."/rediger_titler"," ","class='rediger'");
}
echo "</p><p class='ink'>";

foreach($alle_titler as $a){
	echo "- ";
	echo $a['navn'];
	if(!empty($a['sub_titel'])){ echo " ".$a['sub_titel']; }
	echo " ".$a['prep']." ".anchor("core/vis/se/gruppe/".$a['id_gruppe'], $a['navn_gruppe'], "class='ink'");
	echo br();
}
echo "</p>";

	$this->load->view("core/overunder");

	// Navigation for Begivenheder (Entiteter og Steder knyttet til)
	$this->load->view("core/begivenhed/deltagere_steder");
	
	$this->load->view("core/entitet/oplevelser");

	$this->load->view("core/sted/historie");



?>





	

